package com.junit;

import static org.junit.Assert.*;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class ParameterJunit {
    int expected=0;
    int num1=0;
    int num2=0;
@Parameters 
	public static Collection<Object[]> c()
	{
	return Arrays.asList(new Object[][]{
		{3,1,2},
		{4,2,2}
	}); 
    }
    public ParameterJunit(int expected,int num1,int num2){
    	this.expected=expected;
    	this.num1=num1;
    	this.num2=num2;
    }
	@Test
	public void addTest() {
		assertEquals(expected, new Calculate().add(num1, num2));
	}

}
